import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HrSalaryAdjustmentApplyVO, HrSalaryAdjustmentApplyForm, HrSalaryAdjustmentApplyQuery } from '@/api/general/humanresources/compensation/salary/types';

/**
 * 查询员工薪资调整申请审批列表
 * @param query
 * @returns {*}
 */

export const listHrSalaryAdjustmentApply = (query?: HrSalaryAdjustmentApplyQuery): AxiosPromise<HrSalaryAdjustmentApplyVO[]> => {
  return request({
    url: '/humanresource/hrSalaryAdjustmentApply/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询员工薪资调整申请审批详细
 * @param id
 */
export const getHrSalaryAdjustmentApply = (id: string | number): AxiosPromise<HrSalaryAdjustmentApplyVO> => {
  return request({
    url: '/humanresource/hrSalaryAdjustmentApply/' + id,
    method: 'get'
  });
};

/**
 * 新增员工薪资调整申请审批
 * @param data
 */
export const addHrSalaryAdjustmentApply = (data: HrSalaryAdjustmentApplyForm) => {
  return request({
    url: '/humanresource/hrSalaryAdjustmentApply',
    method: 'post',
    data: data
  });
};

/**
 * 修改员工薪资调整申请审批
 * @param data
 */
export const updateHrSalaryAdjustmentApply = (data: HrSalaryAdjustmentApplyForm) => {
  return request({
    url: '/humanresource/hrSalaryAdjustmentApply',
    method: 'put',
    data: data
  });
};

/**
 * 删除员工薪资调整申请审批
 * @param id
 */
export const delHrSalaryAdjustmentApply = (id: string | number | Array<string | number>) => {
  return request({
    url: '/humanresource/hrSalaryAdjustmentApply/' + id,
    method: 'delete'
  });
};
